# DocType Mapper, Sales Order-Production Plan
[

	# These values are common in all dictionaries
	{
		'creation': '2010-08-08 17:09:36',
		'docstatus': 0,
		'modified': '2011-09-15 15:04:45',
		'modified_by': 'Administrator',
		'owner': 'Administrator'
	},

	# These values are common for all Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'name': '__common__',
		'parent': 'Sales Order-Production Plan',
		'parentfield': 'table_mapper_details',
		'parenttype': 'DocType Mapper'
	},

	# These values are common for all Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'map': 'Yes',
		'match_id': 1,
		'name': '__common__',
		'parent': 'Sales Order-Production Plan',
		'parentfield': 'field_mapper_details',
		'parenttype': 'DocType Mapper'
	},

	# These values are common for all DocType Mapper
	{
		'doctype': 'DocType Mapper',
		'from_doctype': 'Sales Order',
		'module': 'Production',
		'name': '__common__',
		'ref_doc_submitted': 1,
		'to_doctype': 'Production Plan'
	},

	# DocType Mapper, Sales Order-Production Plan
	{
		'doctype': 'DocType Mapper',
		'name': 'Sales Order-Production Plan'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'parenttype',
		'to_field': 'against_document'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'parent',
		'to_field': 'document_no'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'uom',
		'to_field': 'stock_uom'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval:flt(obj.qty)-flt(obj.planned_qty)',
		'to_field': 'prevdoc_total_qty'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'transaction_date',
		'to_field': 'document_date'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_table': 'Sales Order',
		'match_id': 0,
		'to_table': 'Production Plan',
		'validation_logic': 'docstatus =1'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'packing_details',
		'from_table': 'Delivery Note Packing Detail',
		'match_id': 1,
		'to_field': 'pp_details',
		'to_table': 'PP Detail',
		'validation_logic': 'docstatus =1 and qty > planned_qty'
	}
]